import request from '@/config/axios'

export interface DebuggerOrderVO {
  id: number
  workTaskNumber: string
  productNumber: string
  productName: string
  modelSpecification: string
  orderQuantity: string
  drawingNumber: string
  debuggingOrderStatus: number
  completeDate: Date
  debuggingOrderUrl: string
  creatorName: string
  fileId: string
  fileName: string
  filePath: string
}

// 查询调试完工单列表
export const getDebuggerOrderPage = async (params) => {
  return await request.get({ url: `/produce/debugger-order/page`, params })
}

// 查询调试完工单详情
export const getDebuggerOrder = async (id: number) => {
  return await request.get({ url: `/produce/debugger-order/get?id=` + id })
}

// 新增调试完工单
export const createDebuggerOrder = async (data: DebuggerOrderVO) => {
  return await request.post({ url: `/produce/debugger-order/create`, data })
}

// 修改调试完工单
export const updateDebuggerOrder = async (data: DebuggerOrderVO) => {
  return await request.put({ url: `/produce/debugger-order/update`, data })
}

// 提交调试完工单
export const submitDebuggerOrder = async (data: DebuggerOrderVO) => {
  return await request.put({ url: `/produce/debugger-order/submit`, data })
}

// 删除调试完工单
export const deleteDebuggerOrder = async (id: number) => {
  return await request.delete({ url: `/produce/debugger-order/delete?id=` + id })
}

// 导出调试完工单 Excel
export const exportDebuggerOrder = async (params) => {
  return await request.download({ url: `/produce/debugger-order/export-excel`, params })
}
